<extend name="Public:innerbase"/>
<block name="css">
<link rel="stylesheet" href="{:STATICS}/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="{:STATICS}/kindeditor/plugins/code/prettify.css" />
<style class="text/css">
.tab-content{
	padding: 20px 10px 0;
}
.award-img{
	width:80px;height:80px;
}
.btn-upload input[type="file"]{
	position: absolute;
	opacity: 0;
	left: 0;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	margin:0;
	padding:0;
	cursor: pointer;
	z-index: 10000;
}
.award-img-wrapper{position:relative;display: inline-block;margin-right:10px;}
.award-img-warpper img{}
.img-remove{position:absolute;right:0;top:0;width:30px;height:30px;color:rgb(155, 155, 155);cursor:pointer;background:url(/Public/Common/images/triangle-close.png) center no-repeat}
.img-remove:hover{color:red;}
</style>
</block>
<!--link rel="stylesheet" href="{:STATICS}/vote/style.css" /-->
<block name="js">
<include file="Public:upload" />
<script src="{:STATICS}/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="{:STATICS}/kindeditor/lang/zh_CN.js" type="text/javascript"></script>
<script src="{:STATICS}/kindeditor/plugins/code/prettify.js" type="text/javascript"></script>
<script src="{:RES}/js/date/WdatePicker.js" type="text/javascript"></script>
<script src="{:STATICS}/vote/common.js" type="text/javascript"></script>
<script type="text/javascript" src="{:STATICS}/validation/js/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="{:STATICS}/js/holder.min.js"></script>
<script type="text/javascript" charset="utf-8" src="{:STATICS}/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{:STATICS}/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="{:STATICS}/ueditor/lang/zh-cn/zh-cn.js"> </script>
<script type="text/javascript">
$(function(){
	$("#editForm").validationEngine("attach",{ 
		promptPosition:"centerRight",
		scroll:true,
		showOneMessage:true
	});
	var ue = UE.getEditor('UEContent');
});

var editor;
KindEditor.ready(function(K) {
	editor = K.create('#info', {
	resizeType : 1,
	allowPreviewEmoticons : false,
	allowImageUpload : true,
	uploadJson : '/index.php?m=User&c=Qiniu&a=kindEditorUpload',
	items : [
	'source','undo','plainpaste','wordpaste','clearhtml','quickformat','selectall','fullscreen','fontname', 'fontsize','subscript','superscript','indent','outdent','|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','hr']
	});
});

$(function(){
	function check(el){
		if($(el).is(':checked')){
			$('#signEndTime').show();
		}
		else $('#signEndTime').hide();
	}
	check($('#onlineSign'));
	$('#onlineSign').change(function(){
		check(this);
	});
})
</script>

<script type="text/javascript">
	$("[data-toggle='upload-reward-img']>.upload-file").AjaxFileUpload({
		action: "{:U('Qiniu/upload')}",
		onComplete: function(filename, resp) {
			if(resp.error !=0){
				alert(resp.message);
			}
			else{
				var wrapper = $(sprintf(TPL,resp.url,targetName,resp.url));
				wrapper.appendTo('#'+target);
				wrapper.find('.img-remove').click(function(){
					$(this).parent().remove();
				});
			}
		}
	});
	
	$(function(){
		$('[data-toggle="upload-reward-img"]').click(function(){
			window.target = $(this).attr('data-target');
			window.targetName = $(this).attr('data-target-name');
		});
		$('.img-remove').click(function(){
			$(this).parent().remove();
		});
		$('.upload-music').click(function(){
			window.targetMusic = $(this).attr('data-target');
		});
	})
	
	$(".upload-music").AjaxFileUpload({
		action: "/User/Qiniu/Upload.html",
		onSubmit:function(){
			spark.showIndicator();
		},
		onComplete: function(filename, response) {
			spark.hideIndicator();
			if(response.error == 0){
				$('#'+targetMusic).val(response.url);
			}
			else{
				alert(response.message);
			}
		},
		onError: function(ret){
			spark.hideIndicator();
			alert(ret);
		}
	});
</script>
</block>
<block name="content">
<div class="container-fluid">
<div class="page-header">
	<a class="btn btn-sm btn-default" href="{:U('Turn/index')}"><i class="fa fa-chevron-left"></i>&nbsp;返回</a>
</div>

<div style="margin-top:10px;">
	<form class="form-horizontal" method="post" action="">
		
		  <input type="hidden" name="lottery_id" value="{$id}">
		   <input type="hidden" name="status" value="2">

		<div class="form-group">
			<label class="control-label col-xs-2">姓名</label>
			<div class="col-md-4">
				<input type="text" name="name" value="{$vo.name}" class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-xs-2">手机号</label>
			<div class="col-md-4">
				<input type="text" name="mobile" value="{$vo.mobile}" class="form-control">
			</div>
		</div>
		<div class="form-group">
			<label class="control-label col-xs-2">奖品</label>
			<div class="col-md-4">
				<input type="text" name="prize_name" value="{$vo.prize_name}" class="form-control">
			</div>
		</div>
		
		

	
		<div class="form-group">
			<div class="col-md-4 col-xs-offset-2">
				<button type="submit" name="button" class="btn btn-success">保存</button>
			</div>
		</div>
	</form>
</div>
</div>
</block>